package com.stylefeng.guns.common.persistence.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * lg_部门表
 * </p>
 *
 * @author stylefeng123
 * @since 2018-01-31
 */
@TableName("lg_department")
public class Department extends Model<Department> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 父ID
     */
    @NotNull(message="请选择父分类！")
    private Integer pid;
    /**
     * pids
     */
    private String pids;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 简称
     */
    @Length(max = 20, message = "简称字数不能大于20")
    private String simplename;
    /**
     * 全称
     */
    @Length(min = 1, max = 100, message = "部门全称字数必须在1到100之间")
    @NotBlank(message="部门全称不能为空")
    private String fullname;
    /**
     * 提示
     */
    @Length(max = 500, message = "提示字数不能大于500")
    private String tips;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getPids() {
        return pids;
    }

    public void setPids(String pids) {
        this.pids = pids;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getSimplename() {
        return simplename;
    }

    public void setSimplename(String simplename) {
        this.simplename = simplename;
    }

    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Department{" +
        "id=" + id +
        ", pid=" + pid +
        ", pids=" + pids +
        ", sort=" + sort +
        ", simplename=" + simplename +
        ", fullname=" + fullname +
        ", tips=" + tips +
        "}";
    }
}
